import unittest
from time import sleep
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
import Login

class mytest02(unittest.TestCase):
    def setUp(self):
        self.driver =Login.login()
    def test_zhengxiang_02(self):
        self.driver.find_element('link text', '文档管理').click()
        sleep(1)
        self.driver.find_element('link text','单位文档').click()
        sleep(1)
        ele1 = self.driver.find_element('css selector', '#iframe_main')  # 进入单位文档层
        self.driver.switch_to.frame(ele1)
        self.driver.find_element('link text', '单位文档').click()
        sleep(1)
        self.driver.switch_to.default_content()   #跳最外层
        ele2 = self.driver.find_element('css selector', '#iframe_main')   #进新建文件夹层
        self.driver.switch_to.frame(ele2)
        self.driver.find_element('css selector', '#button_addcategory').click()  # 点击新建文件夹
        self.driver.switch_to.default_content()
        ele3= self.driver.find_element('css selector', '.d-content > iframe:nth-child(1)')    #进输入层
        self.driver.switch_to.frame(ele3)
        self.driver.find_element('css selector', '#name').send_keys('ZZH')
        self.driver.find_element('id', 'button_save').click()

    def tearDown(self) -> None:
            self.driver.close()

if __name__ == '__main__':
        unittest.main()



